<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> - 收件箱</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">
    <link th:href="@{/css/bootstrap.css}" rel="stylesheet">
    <link th:href="@{/css/font-awesome.min.css}" rel="stylesheet">
    <link th:href="@{/css/plugins/iCheck/custom.css}" rel="stylesheet">
    <link th:href="@{/css/animate.css}" rel="stylesheet">
    <link th:href="@{/css/style.css}" rel="stylesheet">
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12 animated fadeInRight">
            <div class="mail-box-header">
                <h2>
                    文档历史
                </h2>
            </div>
            <div class="mail-box">
                <div class="mail-body">
                    <table class="table table-hover table-mail"
                           id="bootstrap-table" th:data-url='@{/email/historyList.do}'
                           data-toggle="table"
                           data-pagination="true"
                           data-side-pagination="server"
                           data-query-params="queryParams"
                           data-query-params-type="no"
                           data-toolbar="#toolbar"
                           data-toolbar-align="left"
                           data-buttons-align="right"
                    >
                        <thead>
                        <tr>
                            <th data-width="18%" data-field="createTime">日期</th>
                            <th data-width="65%" data-field="emailSubject">主题</th>
                            <th sec:authorize="hasRole('ADMIN')" data-width="65%" data-field="realname">创建人</th>
                            <th data-width="17%" data-align="center" data-field="emailId" data-formatter="operationFormatter">操作</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>


<!-- 全局js -->
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
<script th:src="@{/js/plugins/bootstrap-table/bootstrap-table.min.js}"></script>
<script th:src="@{/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.js}"></script>
<!-- 自定义js -->
<script th:src="@{/js/content.js}"></script>
<script th:inline="javascript">
    /**
     * 查询数据列表传参数
     * @param params
     * @returns {{current: (number|*), size: (number|*)}}
     */
    function queryParams(params) {
        var param = {};
        param['current'] = params.pageNumber;   //页面大小
        param['size'] = params.pageSize;   //页码
        param['descs'] = 'create_time';
        return param;
    }

    /**
     * 初始化操作按钮
     * @param value
     * @param row
     * @param index
     */
    function operationFormatter(value, row, index) {
        var id = value;
        var result = "";
        var path = [[${ctx}]]+"/email/mailDetail.do?emailId="+id;
        result += "<a  class='btn btn-white btn-sm' href='"+path+"' title='查看'><i class=\"fa fa-folder\"></i> 查看 </a>";
        return result;
    }
</script>
</body>
</html>
